<script type="text/javascript">
    function switchStore(obj) {
        var storeParam = obj.value ? 'store/' + obj.value + '/' : '';
        if (obj.switchParams) {
            storeParam += obj.switchParams;
        }

        setLocation('<?php echo $this->getSwitchUrl() ?>' + storeParam);
    }
</script>